<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>

   </head>
   <script>
       $(function(){
          $(".view").click(function(){

              $("#userName").text($(this).parent().siblings(".userName").text());
              $("#content").text($(this).parent().siblings(".content").text());

              $("#myModal").modal("show");
          }) ;
       });
   function toggleIsShow(t,v){
	   Plugins.waitTips({title:'信息提示',content:'正在操作，请稍后...'});
	   $.post("{:U('Admin/Areas/editiIsShow')}",{id:v,isShow:t},function(data,textStatus){
			var json = WST.toJson(data);
			if(json.status=='1'){
				Plugins.setWaitTipsMsg({content:'操作成功',timeout:1000,callback:function(){
				    location.reload();
				}});
			}else{
				Plugins.closeWindow();
				Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
			}
	   });
   }
   function del(id){
	   Plugins.confirm({title:'信息提示',content:'您确定要删除该投诉吗吗?',okText:'确定',cancelText:'取消',okFun:function(){
		   Plugins.closeWindow();
		   Plugins.waitTips({title:'信息提示',content:'正在操作，请稍后...'});
		   $.post("{:U('Admin/Complaint/del')}",{id:id},function(data,textStatus){
					var json = WST.toJson(data);
					if(json.status=='1'){
						Plugins.setWaitTipsMsg({content:'操作成功',timeout:1000,callback:function(){
						   location.reload();
						}});
					}else{
						Plugins.closeWindow();
						Plugins.Tips({title:'信息提示',icon:'error',content:'操作失败!',timeout:1000});
					}
		   });
	   }});
   }
   </script>
   <body class='wst-page'>
       <input type='hidden' id='parentId' value='{$pArea[areaId]}'/>
       <div class='wst-tbar' style='height:25px;'>


       </div>
       <div class="wst-body"> 
        <table class="table table-hover table-striped table-bordered wst-list">
           <thead>
             <tr>
               <th width='40'>序号</th>
               <th width='80'>用户</th>
               <th >内容</th>
               <th width='200'>时间</th>
               <th width='160'>操作</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='i'>
             <tr>
               <td>{$i}</td>
               <td class="userName">{$vo['loginName']}</td>

               <td >{$vo['content']|mb_substr=###,0,100,"utf-8"}。。。</td>
                 <td class="content" style="display: none">{$vo['content']}</td>
                 <td>{$vo['creatTime']}</td>
               <td>
               <if condition="$pArea['areaType'] lt 1 ">
               <a class="btn btn-default glyphicon glyphicon-pencil view"  >查看</a>&nbsp;
               </if>

               <php>if(in_array('dqlb_02',$WST_STAFF['grant'])){</php>
               <button type="button" class="btn btn-default glyphicon glyphicon-trash" onclick="javascript:del({$vo['id']})"">刪除</button>
               <php>}</php>
               </td>
             </tr>
             </volist>
             <tr>
                <td colspan='5' align='center'>{$Page['pager']}</td>
             </tr>
           </tbody>
        </table>
       </div>


       <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
           <div class="modal-dialog">
               <div class="modal-content">
                   <div class="modal-header">
                       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

                   </div>
                   <div class="modal-body">
                       <table class="table table-bordered">

                           <tr>
                               <td width="100px">用户：</td>
                               <td id="userName"></td>

                           </tr>

                           <tr height="400px">
                               <td>内容</td>
                               <td id="content"></td>

                           </tr>

                       </table>
                   </div>

               </div><!-- /.modal-content -->
           </div><!-- /.modal -->
       </div>
   </body>
</html>